package com.shop2cn.iapi.shenqiriskcontrol.testcase;

import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.shop2cn.iapi.shenqisettlement.parameter.bean.AgentProductBean;
import com.shop2cn.iapi.sqoptrade.parameter.req.PayReq;
import com.shop2cn.iapi.sqoptrade.parameter.req.PlaceOrderReq;
import com.shop2cn.iapi.sqoptrade.parameter.vo.OrderItemVo;
import com.shop2cn.iapi.sqoptrade.parameter.vo.OrderVo;
import com.shop2cn.iapi.sqoptrade.resp.Order;
import com.shop2cn.iapi.sqoptrade.resp.TradingServiceResp;
import com.shop2cn.iapi.sqoptrade.service.PayReqCall;
import com.shop2cn.iapi.sqoptrade.service.PlaceOrderCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.SQPayGateWayCallService;
import com.ymttest.business.service.shenqi.CounterService;
import com.ymttest.business.service.shenqi.DGSQBuildProxyChainCallService;
import com.ymttest.business.service.shenqi.GodmchManageCallService;
import com.ymttest.business.service.shenqi.SqTradingCallService;
import com.ymttest.business.service.shenqi.bean.ShenqiUserSet;
import com.ymttest.database.sqlwapper.shenqirisk.CustomsYearStatisticWrapper;
import com.ymttest.database.sqlwapper.shenqirisk.ShenqiRiskCheckWrapper;
import com.ymttest.utils.constant.ECode;

// 测试前需要在disconf配置shenqiriskcontrol，去除白名单配置
public class Ts_ShenqiRiskCheck {
	
	private static PlaceOrderReq placeOrderReq = new PlaceOrderReq();
	private static PlaceOrderCall placeorderCall = new PlaceOrderCall();
	private static PayReq payReq = new PayReq();
	private static PayReqCall payReqCall = new PayReqCall();
	
	private static long autotest_goodsOwnerId = ShenqiUserSet.autotest_goodsOwnerId;
	private static long yabandGoodsOwnerId = ShenqiUserSet.yabandGoodsOwnerId;
	private static long shenqiRiskControlGoodsOwnerId = ShenqiUserSet.shenqiRiskControlGoodsOwnerId;
	private static long dualPayModeGoodsOwnerId = ShenqiUserSet.dualPayModeGoodsOwnerId;
	
	private static CustomsYearStatisticWrapper customsYearStatisticWrapper = new CustomsYearStatisticWrapper();
	
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("神器风控业务");
	}

	@Before
	public void caseUp() {
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult("shenqiRiskCheck");
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	
	public String getStatisticYear() {

		Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT+08:00"));

		SimpleDateFormat s = new SimpleDateFormat("yyyyMM");

		String statisticYear = s.format(c.getTime());

		return statisticYear;
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_001() {
		Logger.start(true, "一次下单多个商品,其中一个商品数×总金额大于等于20w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);
			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(0, BigDecimal.ZERO, 20238699,
							productBean, autotest_goodsOwnerId);

			OrderItemVo orderItemVo = SqTradingCallService
					.createOrderItemVo(productBean.getProductId(), productBean
							.getCatalogList().get(1));

			orderItemVo.setProductPrice(new BigDecimal("2001"));
			orderItemVo.setProductNum(10);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.getOrderItems().add(orderItemVo);

			placeOrderReq.setDiscount(new BigDecimal("10.00"));
			placeOrderReq.setShenqiProxyBuyOrder(true);
			placeOrderReq.setShenqiBuyOrderCsId(1235678L);
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_002() {
		Logger.start(true, "渠道商一次下单一个商品,商品单价为100，商品数×总金额大于等于10w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("100"));
			orderItemVo.setProductNum(32);
			
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getErrorCodeValue(),
					"校验errorCodeValue");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_003() {
		Logger.start(true, "渠道商一次下单一个商品,商品单价为1000，商品数×总金额大于等于10w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("1000"));
			orderItemVo.setProductNum(11);
			
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getErrorCodeValue(),
					"校验errorCodeValue");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_004() {
		Logger.start(true, "渠道商一次下单一个商品,商品单价为20000，商品数×总金额大于等于5w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("20000"));
			orderItemVo.setProductNum(3);

			orderItemVo.setFreight(BigDecimal.ZERO);
			
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getErrorCodeValue(),
					"校验errorCodeValue");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_005() {
		Logger.start(true, "渠道商一次下单一个商品,商品单价为10000，商品数×总金额大于等于5w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("10000"));
			orderItemVo.setProductNum(6);
			
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getErrorCodeValue(),
					"校验errorCodeValue");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_006() {
		Logger.start(true, "渠道商一次下单一个商品,外币标价商品，商品单价1w，商品数×总金额大于等于5w，风控下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false,
							true);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			placeOrderReq.setCurrency(productBean.getCurrency());

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("10000"));
			orderItemVo.setProductNum(3);

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_007() {
		Logger.start(true, "盛付通用户一次下单一个商品,商品单价为1000，商品数×总金额大于等于10w，风控下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createShengPayProxychain(500381009, 1);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, 500381009);

			placeOrderReq.setPayChannelType(2);
			placeOrderReq.setCurrency(productBean.getCurrency());

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("1000"));
			orderItemVo.setProductNum(10);

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_008() {
		Logger.start(true, "神器代理 下单一个商品,商品单价为10000，商品数×总金额大于等于5w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			placeOrderReq.setShenqiProxyBuyOrder(true);
			placeOrderReq.setShenqiBuyOrderCsId(54632L);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("10000"));
			orderItemVo.setProductNum(6);
			
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getErrorCodeValue(),
					"校验errorCodeValue");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_009() {
		Logger.start(true,
				"渠道商一次下单一个商品,商品单价为20000，商品数×总金额大于等于5w，支持线下支付的订单，不被风控，下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("20000"));
			orderItemVo.setProductNum(3);

			orderItemVo.setFreight(BigDecimal.ZERO);

			placeOrderReq.setSupportOfflinePay(true);
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_010() {
		Logger.start(true, "一次下单多个商品,其中一个商品金额为1，数量×总金额大于等于20w，风控下单失败");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);
			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(0, BigDecimal.ZERO, 20238699,
							productBean, autotest_goodsOwnerId);

			OrderItemVo orderItemVo1 = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo1.setProductNum(200000);
			orderItemVo1.setProductPrice(BigDecimal.ONE);

			OrderItemVo orderItemVo2 = SqTradingCallService
					.createOrderItemVo(productBean.getProductId(), productBean
							.getCatalogList().get(1));

			orderItemVo2.setProductPrice(new BigDecimal("199999"));
			orderItemVo2.setProductNum(1);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.getOrderItems().add(orderItemVo2);

			placeOrderReq.setShenqiProxyBuyOrder(true);
			placeOrderReq.setShenqiBuyOrderCsId(1235678L);
			placeOrderReq.setCurrency("CNY");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("亲爱的，交易异常~请联系商家吧~"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_011() {
		Logger.start(true,
				"yabandGoodsOwnerId下单，不被风控，下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) yabandGoodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) yabandGoodsOwnerId);

			OrderItemVo orderItemVo = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo.setProductPrice(new BigDecimal("20000"));
			orderItemVo.setProductNum(3);

			orderItemVo.setFreight(BigDecimal.ZERO);

			placeOrderReq.setPayChannelType(3);

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_012() {
		Logger.start(true, "渠道商一次下单，地址被风控禁止下单");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			
			placeOrderReq.setAddress("a河南省,郑州市,新郑市,新港街道航空港区新港大道新中集运海运仓irl21345124");
			
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，您的地址异常无法下单，给您带来不便深表歉意"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_013() {
		Logger.start(true, "渠道商一次下单，黑名单用户下单黑名单商品，风控禁止下单");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			
			// 黑名单手机号
			placeOrderReq.setRecvMobile("13671492546");
			
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);
			
			// 黑名单商品sku
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0).getOrderItems().get(0).setSku("sku无法购买");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，您不能下单该商品，给您带来不便深表歉意"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_014() {
		Logger.start(true, "渠道商一次下单，多个商品，其中一个商品为黑名单商品，风控禁止下单");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			
			// 黑名单手机号
			placeOrderReq.setRecvMobile("13671492546");
			
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);
			
			// 黑名单商品sku			
			OrderItemVo orderItemVo = SqTradingCallService
					.createOrderItemVo(productBean.getProductId(), productBean
							.getCatalogList().get(1));

			orderItemVo.setSku("sku无法购买");

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.getOrderItems().add(orderItemVo);

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，您不能下单该商品，给您带来不便深表歉意"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_015() {
		Logger.start(true, "直销商下单组合商品，组合商品主商品为黑名单商品，风控禁止下单");
		try {
			AgentProductBean productBean1 = DGSQBuildProxyChainCallService
					.createComposeProductProxychain(
							(int) autotest_goodsOwnerId, false, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(0, BigDecimal.ZERO, 20238699,
							productBean1, productBean1.getSellerId(), false);

			OrderItemVo orderItemVo1 = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo1.setSubProduct(true);
			orderItemVo1.setProdTaxRate(new BigDecimal("0.17"));
			
			orderItemVo1.setSku("sku无法购买");
			
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);
			
			// 黑名单手机号
			placeOrderReq.setRecvMobile("13671492546");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，您不能下单该商品，给您带来不便深表歉意"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_016() {
		Logger.start(true, "渠道商一次下单，非黑名单用户下单黑名单商品，风控下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			
			// 黑名单商品sku
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.getOrderItems().get(0).setSku("sku无法购买");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_017() {
		Logger.start(true, "渠道商一次下单，黑名单用户下单普通商品，风控下单成功");
		try {
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(4321, BigDecimal.ZERO,
							20238699, productBean, (int) autotest_goodsOwnerId);
			
			// 黑名单手机号
			placeOrderReq.setRecvMobile("13671492546");
			
			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_018() {
		Logger.start(true, "直销商下单组合商品，组合商品主商品为黑名单商品，手机号在月统计黑名单中，风控禁止下单");
		try {
			AgentProductBean productBean1 = DGSQBuildProxyChainCallService
					.createComposeProductProxychain(
							(int) autotest_goodsOwnerId, false, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(0, BigDecimal.ZERO, 20238699,
							productBean1, productBean1.getSellerId(), false);
			
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);

			OrderItemVo orderItemVo1 = placeOrderReq.getOrderGroups().get(0)
					.getOrders().get(0).getOrderItems().get(0);

			orderItemVo1.setSubProduct(true);
			orderItemVo1.setProdTaxRate(new BigDecimal("0.17"));
			
			orderItemVo1.setSku("sku无法购买");
			
			// 黑名单手机号
			placeOrderReq.setRecvMobile("13671492546");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，您不能下单该商品，给您带来不便深表歉意"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_019() {
		Logger.start(true, "开启了商户风控，符合海关风控条件，用户可以下单");
		try {
			
			HashMap<String, String> bizConfigMap = new HashMap<>();
			
			bizConfigMap.put("customs_risk_rule", "1");
			
			GodmchManageCallService.setBizConfig(shenqiRiskControlGoodsOwnerId, bizConfigMap);
			
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createMultiCodeProxychain((int) shenqiRiskControlGoodsOwnerId, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(1234L, BigDecimal.ZERO, 20238699,
							productBean, shenqiRiskControlGoodsOwnerId);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);
			placeOrderReq.setRecvMobile("13671492546");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(200, placeorderCall.getCode(), "校验msg");
			Logger.verifyEquals(true,
					placeorderCall.getData().getBoolean("success"), "校验success");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPlaceOrder_020() {
		Logger.start(true, "开启了平台风控，符合海关风控条件，用户禁止下单");
		try {
			
			HashMap<String, String> bizConfigMap = new HashMap<>();
			
			bizConfigMap.put("customs_risk_rule", "2");
			
			GodmchManageCallService.setBizConfig(shenqiRiskControlGoodsOwnerId, bizConfigMap);
			
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createMultiCodeProxychain((int) shenqiRiskControlGoodsOwnerId, false);

			placeOrderReq = SqTradingCallService
					.buildDGSQStandPlaceOrderReq(1234L, BigDecimal.ZERO, 20238699,
							productBean, shenqiRiskControlGoodsOwnerId);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setPurchaserIdcardId(3L);

			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiIdCardRequirement(1);
			placeOrderReq.getOrderGroups().get(0).getOrders().get(0)
					.setShenqiLogisticsType(4);
			placeOrderReq.setRecvMobile("13671492546");

			placeorderCall.setData(placeOrderReq);
			placeorderCall.callService();

			Logger.verifyEquals(201, placeorderCall.getCode(), "校验code");
			Logger.verifyEquals(118, placeorderCall.getBcode(), "校验bcode");

			Logger.verifyEquals(true,
					placeorderCall.getMsg().contains("抱歉，海关监控账号异常，请更换账号下单"),
					"校验msg");
			Logger.verifyEquals(false,
					placeorderCall.getData().getBoolean("success"), "校验success");
			
			bizConfigMap.put("customs_risk_rule", "1");
			
			GodmchManageCallService.setBizConfig(shenqiRiskControlGoodsOwnerId, bizConfigMap);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_001() {
		Logger.start(true, "代购神器直销订单，国外ip，设置风控金额，盛付通渠道不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(dualPayModeGoodsOwnerId,
					new BigDecimal("10000"), BigDecimal.ONE);

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) dualPayModeGoodsOwnerId, 0, false);

			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean, 1, 2, dualPayModeGoodsOwnerId,
							productBean.getCurrency());

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.124.0");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(dualPayModeGoodsOwnerId, null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_002() {
		Logger.start(true, "代购神器直销订单，国外ip，设置风控金额，外币通道，盛付通渠道不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(dualPayModeGoodsOwnerId,
					new BigDecimal("10000"), BigDecimal.ONE);

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) dualPayModeGoodsOwnerId, 0, false);

			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean, 2, 2, dualPayModeGoodsOwnerId,
							productBean.getCurrency());

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(
					dualPayModeGoodsOwnerId, null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_003() {
		Logger.start(true, "代购神器代理订单，国外ip，hipoPay渠道被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean);

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("202.135.192.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bcode");
			Logger.verifyEquals("亲爱的，请在国内下单哦~", payReqCall.getMsg(), "验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_004() {
		Logger.start(true, "代购神器代理订单，货头设置风控金额，国外ip，hipoPay渠道不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean);

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(autotest_goodsOwnerId,
					new BigDecimal("10000"), BigDecimal.ONE);
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");
			
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("202.135.192.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(autotest_goodsOwnerId,
					null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_005() {
		Logger.start(true, "代购神器代理订单，渠道商设置风控金额，国内ip，hipoPay渠道，支付金额超过限额，不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean);

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null,
					totalPrice.subtract(BigDecimal.ZERO));

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_006() {
		Logger.start(true, "代购神器直销订单，渠道商设置风控金额，国内ip，hipoPay渠道，支付金额超过限额，被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder1(productBean, productBean.getSellerId());

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), totalPrice,
					totalPrice.subtract(BigDecimal.ONE));

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bcode");
			Logger.verifyEquals(
					String.format("亲爱的，你的支付金额不能超过%s，请联系卖家",
							totalPrice.subtract(BigDecimal.ONE)),
					payReqCall.getMsg(), "验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_007() {
		Logger.start(true, "代购神器直销订单，渠道商设置风控金额，国内ip，hipoPay渠道，支付金额等于限额，不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder1(productBean, productBean.getSellerId());

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), totalPrice, totalPrice);
			
			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_008() {
		Logger.start(true, "代购神器直销订单，渠道商设置风控金额，国内ip，hipoPay渠道，支付金额小于限额，不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder1(productBean, productBean.getSellerId());

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), totalPrice,
					totalPrice.add(BigDecimal.ONE));

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_009() {
		Logger.start(true, "代购神器直销外币订单，渠道商设置风控金额，国内ip，hipoPay渠道，支付金额大于限额，被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false,
							true);
			String currency = productBean.getCurrency();
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean, BigDecimal.ZERO,
							productBean.getSellerId(), currency);

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), totalPrice,
					totalPrice.add(BigDecimal.ONE));

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("h5sqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bcode");
			Logger.verifyEquals(
					String.format("亲爱的，你的支付金额不能超过%s，请联系卖家",
							totalPrice.add(BigDecimal.ONE)),
					payReqCall.getMsg(), "验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_010() {
		Logger.start(true,
				"代购神器代理订单，商家端购买，风控使用openId查看（需要在shenqiriskcontrol服务器查看日志）");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 1, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrder(productBean, true);

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal totalPrice = placeOrderResp.getPayableAmount();
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 设置风控金额
			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), totalPrice,
					totalPrice.add(BigDecimal.ONE));

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("h5sqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_011() {
		Logger.start(true, "代购神器外币标价直销订单，支付人民币超过5w，盛付通渠道被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain(500583265, 0, false, true);

			PlaceOrderReq placeOrderReq = SqTradingCallService
					.placeOrderOver50000(productBean, 2, 500583265L,
							productBean.getCurrency());

			TradingServiceResp placeOrderResp = SqTradingCallService
					.callPlaceOrderService(placeOrderReq);

			List<Order> orderList = placeOrderResp.getOrderList();
			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，你的支付金额不能超过5W，请联系卖家", payReqCall.getMsg(),
					"验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_012() {
		Logger.start(true, "代购神器外币标价直销订单，支付人民币超过5w，白名单用户，盛付通渠道不被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) autotest_goodsOwnerId, 0, false,
							true);

			PlaceOrderReq placeOrderReq = SqTradingCallService
					.placeOrderOver50000(productBean, 2, autotest_goodsOwnerId,
							productBean.getCurrency());

			TradingServiceResp placeOrderResp = SqTradingCallService
					.callPlaceOrderService(placeOrderReq);

			List<Order> orderList = placeOrderResp.getOrderList();
			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals(ECode.SUCCESS, payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("JSON", payReqCall.getData().get("resultType"),
					"验证Code");

			GodmchManageCallService.setRiskAmount(
					productBean.getSellerId(), null, null);

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_013() {
		Logger.start(true, "代购神器直销订单，支付人民币超过5w，盛付通渠道被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int)dualPayModeGoodsOwnerId, 0, false);

			PlaceOrderReq placeOrderReq = SqTradingCallService
					.placeOrderOver50000(productBean, 2, dualPayModeGoodsOwnerId,
							productBean.getCurrency());

			TradingServiceResp placeOrderResp = SqTradingCallService
					.callPlaceOrderService(placeOrderReq);

			List<Order> orderList = placeOrderResp.getOrderList();
			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，你的支付金额不能超过5W，请联系卖家", payReqCall.getMsg(),
					"验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_014() {
		Logger.start(true, "代购神器一个直销订单，一个代理订单，支付人民币超过5w，盛付通渠道被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int)dualPayModeGoodsOwnerId, 1, false);

			AgentProductBean productBean2 = DGSQBuildProxyChainCallService
					.createProxychain((int) productBean.getSellerId(), 0, false);

			PlaceOrderReq placeOrderReq = SqTradingCallService
					.placeOrderOver50000(productBean, 2, dualPayModeGoodsOwnerId,
							productBean.getCurrency());

			OrderVo orderVo2 = SqTradingCallService.createOrderVo(Arrays
					.asList(productBean2));

			placeOrderReq.getOrderGroups().get(0).getOrders().add(orderVo2);

			TradingServiceResp placeOrderResp = SqTradingCallService
					.callPlaceOrderService(placeOrderReq);

			List<Order> orderList = placeOrderResp.getOrderList();
			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");
			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，你的支付金额不能超过5W，请联系卖家", payReqCall.getMsg(),
					"验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({ P1.class })
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_015() {
		Logger.start(true, "代购神器两个直销订单，支付人民币超过5w，盛付通渠道被风控");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int)dualPayModeGoodsOwnerId, 0, false);

			AgentProductBean productBean2 = DGSQBuildProxyChainCallService
					.createProxychain((int)dualPayModeGoodsOwnerId, 0, false);

			PlaceOrderReq placeOrderReq = SqTradingCallService
					.placeOrderOver50000(productBean, 2, dualPayModeGoodsOwnerId,
							productBean.getCurrency());

			OrderVo orderVo2 = SqTradingCallService.createOrderVo(Arrays
					.asList(productBean2));

			placeOrderReq.getOrderGroups().get(0).getOrders().add(orderVo2);

			TradingServiceResp placeOrderResp = SqTradingCallService
					.callPlaceOrderService(placeOrderReq);

			List<Order> orderList = placeOrderResp.getOrderList();
			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			BigDecimal useAccountAmount = BigDecimal.ZERO;

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(useAccountAmount);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("172.17.21.73");
			payReq.setBankId("123");
			payReq.setPayType("6010");
			payReq.setOpenId(SQPayGateWayCallService.SFTWxOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，你的支付金额不能超过5W，请联系卖家", payReqCall.getMsg(),
					"验证msg");
			Logger.verifyEquals(118, payReqCall.getErrorCodeValue(),
					"验证errorCodeValue");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	// mchNo可以从shenqiriskcontrol.iapi.ymatou.com的biz.log中获取
	public void Tc_ShenqiRiskCheckForPayOrder_016() {
		Logger.start(true, "一天付款笔数超过分控限额，风控支付失败");
		try {
			// 创建订单
			Logger.comment("前置数据准备");
			
			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) 502216124, 0, false);

			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrderWithUserId(productBean, 25894592L);

			CounterService.setUserPaidCounter(15, "hpAccount_20238");

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(BigDecimal.ZERO);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，今天买太多，先歇歇吧~", payReqCall.getMsg(), "验证msg");

			CounterService.setUserPaidCounter(-15, "hpAccount_20238");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_ShenqiRiskCheckForPayOrder_017() {
		Logger.start(true, "一个月付款总金额超过分控限额，风控支付失败");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createProxychain((int) 502216124, 0, false);
			TradingServiceResp placeOrderResp = SqTradingCallService
					.placeOrderWithUserId(productBean, 25894592L);

			CounterService.setUserPaidAmountSum(30000000, "hpAccount_20238");

			List<Order> orderList = placeOrderResp.getOrderList();

			List<Long> orderIds = new ArrayList<Long>();

			orderList.forEach(o -> orderIds.add(o.getOrderId()));

			Long userId = placeOrderResp.getUserId();

			Logger.comment("前置数据准备结束");

			// 参数
			payReq.setCallbackUrl("www.ymtautotest.com");
			payReq.setUserId(userId);
			payReq.setUseAccountAmount(BigDecimal.ZERO);
			payReq.setOrderIds(orderIds);

			String tradingPassword = "abc123";
			payReq.setTradingPwd(tradingPassword);
			payReq.setUserIp("103.84.20.0");
			payReq.setBankId("123");
			payReq.setPayType("6000");
			payReq.setOpenId(SQPayGateWayCallService.HipoPayWxAppOpenId);
			payReq.setParamExt("");
			payReq.setMemo("备注");
			payReq.setShenqiMpId("wxsqBuyer");

			// 发送请求
			payReqCall.setData(payReq);
			payReqCall.callService();

			Logger.verifyEquals("201", payReqCall.getCode(), "验证Code");
			Logger.verifyEquals("118", payReqCall.getBCode(), "验证bCode");
			Logger.verifyEquals("亲爱的，今天买太多，先歇歇吧~", payReqCall.getMsg(), "验证msg");

			CounterService.setUserPaidAmountSum(-30000000, "hpAccount_20238");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_ShenqiRiskCheckForAcceptOrder_001() {
		Logger.start(true, "代购神器交易下单,自动接单，自动接单时，被风控拦截");
		try {
			// 创建订单
			Logger.comment("前置数据准备");

			// 更新dualPayModeGoodsOwnerId用户、13671492546手机号的4个不同身份证的当前月份
			String statisticYear = this.getStatisticYear();

			customsYearStatisticWrapper.updateYearBySellerIdAndPhone(
					statisticYear, shenqiRiskControlGoodsOwnerId, "13671492546");

			AgentProductBean productBean = DGSQBuildProxyChainCallService
					.createMultiCodeProxychain(
							(int) shenqiRiskControlGoodsOwnerId, false);

			TradingServiceResp placeOrder = SqTradingCallService
					.placeOrderWithBlackList(productBean, 3L,
							shenqiRiskControlGoodsOwnerId);

			long userId = placeOrder.getUserId();

			Long thirdTradingId = SqTradingCallService.payOrder(userId,
					placeOrder.getTradingId());

			BigDecimal totalPrice = placeOrder.getPayableAmount();

			// 支付网关支付回调交易
			SQPayGateWayCallService.DGSQNotifyCall(
					String.valueOf(thirdTradingId),
					totalPrice.subtract(BigDecimal.ZERO).toString(),
					(int) userId, BigDecimal.ZERO.toPlainString());

			Logger.comment("前置数据准备结束");
			
			ShenqiRiskCheckWrapper shenqiRiskCheckWrapper = new ShenqiRiskCheckWrapper();
			
			String actualReason = shenqiRiskCheckWrapper
					.selectByGoodsOwnerIdAndUserId(
							shenqiRiskControlGoodsOwnerId, userId).getReason();

			Logger.verifyEquals(String.format(
					"用户：%s,商户：%s下,该订单%s电话13671492546对应4个不同的身份证", userId,
					shenqiRiskControlGoodsOwnerId, placeOrder.getOrderList()
							.get(0).getOrderId()), actualReason, "验证reason");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}
